package com.qingcloud.wcenter.api;

import com.qingcloud.wcenter.model.air.AQIForecast;
import com.qingcloud.wcenter.model.air.AirForecastData;
import com.qingcloud.wcenter.model.air.CityAirData;
import com.qingcloud.wcenter.model.cdata.params.CityDataParams;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "air-data-api", url = "${healthy.data-url}")
public interface AirDataApi {

    /**
     * 区域最新小时的天气数据查询
     */
    @GetMapping(value = "/air/hour/{domainId}")
    CityAirData findLastByDomainId(@PathVariable("domainId") Integer domainId);

    /**
     * 按时间查询天数据
     */
    @PostMapping(value = "/air/day")
    CityAirData findMinuteDataByRtcTime(@RequestBody CityDataParams cityDataParams);

    /**
     * 获取指定区域气象预报数据
     */
    @GetMapping(value = "/air/forecast/{domainId}")
    List<AirForecastData> findAirForecastData(@PathVariable("domainId") Integer domainId);

    /**
     * 获取指定区域Aqi预报数据
     */
    @GetMapping(value = "/air/aqiForecast")
    List<AQIForecast> findAqiForecastData(@RequestParam("domainId") String domainId,
                                          @RequestParam("districtName") String districtName,
                                          @RequestParam("cityName") String cityName,
                                          @RequestParam("provinceName") String provinceName);

}
